# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=pspg
pkgver=5.8.5
pkgrel=0
pkgdesc="A unix pager optimized for psql"
url="https://github.com/okbob/pspg"
arch="all"
options="!check" # there is no tests
license="BSD-2-Clause"
makedepends="automake autoconf libpq-dev ncurses-dev readline-dev"
subpackages="$pkgname-doc"
source="https://github.com/okbob/pspg/archive/$pkgver/pspg-$pkgver.tar.gz"

prepare() {
	default_prepare
	./autogen.sh
}

build() {
	# getpass
	CFLAGS="$CFLAGS -D_BSD_SOURCE" \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var
	make
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dm644 pspg.1 -t "$pkgdir"/usr/share/man/man1/
}

sha512sums="
f33be2e0ddd8f56054c82f4f3a8ea531faef2f9ca21a706f894f5419e8122d291a9174495d68dc8637728cc57fe764e63c34b843e8ed8a3b3ff7546a6c904e7e  pspg-5.8.5.tar.gz
"
